package dto

import (
	"github.com/gin-gonic/gin"
	"tino_manager/public"
)

type NoticeAddInput struct {
	Title   string `json:"title" form:"title" comment:"通知标题" validate:"required"`
	Images  string `json:"images" form:"images" comment:"图片" validate:"required"`
	Content string `json:"content" form:"content" comment:"通知正文" validate:"required"`
	Sort    int    `json:"sort" form:"sort" comment:"通知排序"`
}

func (params *NoticeAddInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type NoticePageInput struct {
	Title      string `json:"title" form:"title" comment:"标题"`
	Type       string `json:"type" form:"type" comment:"类型"`
	PageSize   int    `json:"page_size" form:"page_size" comment:"每页数量" validate:"required,lte=20"`
	PageNumber int    `json:"page_number" form:"page_number" comment:"页码" validate:"required"`
}

func (params *NoticePageInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type NoticeInfo struct {
	Id        string `json:"id" form:"id"`
	Title     string `json:"title" form:"title"`
	Content   string `json:"content" form:"content"`
	Images    string `json:"images" form:"images"`
	Sort      int    `json:"sort" form:"sort"`
	Status    uint8  `json:"status" from:"status"`
	CreatedAt string `json:"created_at" form:"created_at"`
}
type NoticePageOutput struct {
	List  []NoticeInfo `json:"list"`
	Total int64        `json:"total"`
}
type NoticeDetailInput struct {
	Id string `json:"id" form:"id" comment:"通知id" validate:"required"`
}

func (params *NoticeDetailInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type NoticeUpdateInput struct {
	Id      string `json:"id" form:"id" validate:"required"`
	Title   string `json:"title" form:"title" comment:"通知标题" validate:"required"`
	Images  string `json:"images" form:"images" comment:"图片" validate:"required"`
	Content string `json:"content" form:"content" comment:"通知正文" validate:"required"`
	Sort    int    `json:"sort" form:"sort" comment:"通知排序"`
}

func (params *NoticeUpdateInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type NoticeUpdateStatusInput struct {
	Id     string `json:"id" form:"id" comment:"通知id" validate:"required"`
	Status uint8  `json:"status" form:"status"`
}

func (params *NoticeUpdateStatusInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}
